#include<stdio.h>
#include<sys/stat.h>
#include<sys/types.h>
#include<unistd.h>
#include<fcntl.h>
#include<string.h>

int main(int argc, char const *argv[])
{
	int fd1, fd2;
	char buf;
	if(argc != 3)
	{
		printf("error parameter\n");
		return 0;
	}
	if((fd1 = open(argv[1],O_WRONLY | O_APPEND)) < 0)
	{
		printf("error filename\n");
		return 0;
	}
	if((fd2 = open(argv[2],O_RDONLY)) < 0)
	{
		printf("error filename\n");
		return 0;
	}

	while(read(fd2, &buf, 1))
	{
		write(fd1, &buf, 1);
	}

	close(fd1);
	close(fd2);

	return 0;
}